package java基础知识.java泛型;

import java.util.Arrays;

/**
 * @author coderFu
 * @create 2022/3/11
 * 泛型方法
 */
public class CoderGenericMethod {



    public <T> T test(Class<T>  tClass) throws IllegalAccessException, InstantiationException {
        // 通过class 类来创建实例对象
        T t = tClass.newInstance();
        return t;
    }

    public <T> void test(T ...ts){
        System.out.println(Arrays.toString(ts));
    }
}
